package com.ruoyi.project.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.system.mapper.SysReceiveCouponMapper;
import com.ruoyi.project.system.domain.SysReceiveCoupon;
import com.ruoyi.project.system.service.ISysReceiveCouponService;

/**
 * 我领取的优惠券Service业务层处理
 * 
 * @author jjp
 * @date 2020-04-22
 */
@Service
public class SysReceiveCouponServiceImpl implements ISysReceiveCouponService 
{
    @Autowired
    private SysReceiveCouponMapper sysReceiveCouponMapper;

    /**
     * 查询我领取的优惠券
     * 
     * @param receiveId 我领取的优惠券ID
     * @return 我领取的优惠券
     */
    @Override
    public SysReceiveCoupon selectSysReceiveCouponById(Long receiveId)
    {
        return sysReceiveCouponMapper.selectSysReceiveCouponById(receiveId);
    }

    /**
     * 查询我领取的优惠券列表
     * 
     * @param sysReceiveCoupon 我领取的优惠券
     * @return 我领取的优惠券
     */
    @Override
    public List<SysReceiveCoupon> selectSysReceiveCouponList(SysReceiveCoupon sysReceiveCoupon)
    {
        return sysReceiveCouponMapper.selectSysReceiveCouponList(sysReceiveCoupon);
    }

    /**
     * 新增我领取的优惠券
     * 
     * @param sysReceiveCoupon 我领取的优惠券
     * @return 结果
     */
    @Override
    public int insertSysReceiveCoupon(SysReceiveCoupon sysReceiveCoupon)
    {
        sysReceiveCoupon.setCreateTime(DateUtils.getNowDate());
        return sysReceiveCouponMapper.insertSysReceiveCoupon(sysReceiveCoupon);
    }

    /**
     * 修改我领取的优惠券
     * 
     * @param sysReceiveCoupon 我领取的优惠券
     * @return 结果
     */
    @Override
    public int updateSysReceiveCoupon(SysReceiveCoupon sysReceiveCoupon)
    {
        return sysReceiveCouponMapper.updateSysReceiveCoupon(sysReceiveCoupon);
    }

    /**
     * 批量删除我领取的优惠券
     * 
     * @param receiveIds 需要删除的我领取的优惠券ID
     * @return 结果
     */
    @Override
    public int deleteSysReceiveCouponByIds(Long[] receiveIds)
    {
        return sysReceiveCouponMapper.deleteSysReceiveCouponByIds(receiveIds);
    }

    /**
     * 删除我领取的优惠券信息
     * 
     * @param receiveId 我领取的优惠券ID
     * @return 结果
     */
    @Override
    public int deleteSysReceiveCouponById(Long receiveId)
    {
        return sysReceiveCouponMapper.deleteSysReceiveCouponById(receiveId);
    }

    @Override
    public List<SysReceiveCoupon> selectUserCoupon(Long mobileUserId) {
        return sysReceiveCouponMapper.selectUserCoupon(mobileUserId);
    }

    @Override
    public List<SysReceiveCoupon> notCoupon(Long mobileUserId) {
        return sysReceiveCouponMapper.notCoupon(mobileUserId);
    }

    @Override
    public List<SysReceiveCoupon> yesCoupon(Long mobileUserId) {
        return sysReceiveCouponMapper.yseCoupon(mobileUserId);
    }

    @Override
    public List<SysReceiveCoupon> notUseCoupon(Long mobileUserId) {
        return sysReceiveCouponMapper.notUseCoupon(mobileUserId);
    }
}
